Page({
  data:{
    hot:[],
    banner:"",
    cds:[]
  },
  onLoad(){
    var reqTask = wx.request({
      url: 'http://localhost:8000/music',
      data: {},
      header: {'content-type':'application/json'},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: (result)=>{
        // console.log(result.data.result);
        var banner = result.data.result.banner
        var hot = result.data.result.hot
        var cds = result.data.result.newCd.slice(0,4)
        this.setData({
          banner,
          hot,
          cds
        })
      },
      fail: ()=>{},
      complete: ()=>{}
    });
  }
})
